
package com.gamatechno.solodestinationnew;

import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.gamatechno.solodestinationnew.utils.Utils;

public class SettingActivity extends BaseActivity implements OnItemClickListener {

    private ListView lvSetting;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting);

        getSupportActionBar().setDisplayHomeAsUpEnabled(false);

        lvSetting = (ListView) findViewById(R.id.lv_setting);

        String[] menu = {
                getResources().getString(R.string.txt_change_lang)
        };

        lvSetting.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,
                menu));

        lvSetting.setOnItemClickListener(this);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        // getMenuInflater().inflate(R.menu.setting, menu);
        return true;
    }

    @Override
    public void onItemClick(AdapterView<?> arg0, View arg1, int pos, long arg3) {
        // TODO Auto-generated method stub

        if (pos == 0) {
            Bundle data = new Bundle();
            data.putInt("setting", 1);
            startActivity(new Intent(this, PilihBahasaActivity.class).putExtras(data));
            finish();
        }
    }

    @Override
    protected void onResume() {
        // TODO Auto-generated method stub
        super.onResume();
        // Utils.setLocale(this, Utils.getDataStringFromSP(this,
        // Utils.PREF_BAHASA));
        Utils.TRACE("SettingActivity", "onResume : ");
    }

    @Override
    public void onBackPressed() {
        // TODO Auto-generated method stub
        super.onBackPressed();
        startActivity(new Intent(this, MainActivity.class));
        finish();
    }

}
